package com.yuqian;

import com.yuqian.Resposoyory.OffOnlineMessageReponsitory;
import com.yuqian.bean.OffOnlineMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by Administrator on 2017/7/24 0024.
 */

@RestController
public class HelloWorld {

    @Autowired
   private OffOnlineMessageReponsitory reponsitory;

    @RequestMapping("/hello")
    public String index(){
        OffOnlineMessage offOnlineMessage=new OffOnlineMessage();
        System.out.println("测试");
        offOnlineMessage.setUserId("1");
        offOnlineMessage.setState("0");
        offOnlineMessage.setContent("测试");
        offOnlineMessage.setMessageType("message");
        offOnlineMessage.settowhere("2");
        offOnlineMessage.setfromwhere("system");
        offOnlineMessage.setMessage("text");
        offOnlineMessage.setRecode("1");
        offOnlineMessage.setDeviceType("PC");
        reponsitory.save(offOnlineMessage);

        return "Hello World";
    }
}
